import request from '@/scripts/request'

// 获取省市
export function getSearchCondition() {
  return request.get(`/bridge/overall/getSearchCondition`)
}
// 通航要素
export function getNavigationFators() {
  return request.get(`/bridge/overall/navigationFators`)
}
// 搜索桥梁
export function getSearchConditionBybridge() {
  return request.get(`/bridge/bridgeSituation/getSearchCondition`)
}
// 搜索航道
export function getSearchConditionByChannel() {
  return request.get(`/bridge/waterwaySituation/getSearchCondition`)
}

export function getSearchByWaterwayName(waterwayName) {
  return request({
    url: `/bridge/waterwaySituation/searchByWaterwayName?waterwayName=${waterwayName}`,
    method: 'get',
  })
}
// 航道基本信息
export function getBaseInfo(waterwayId) {
  return request.get(
    `/bridge/waterwaySituation/baseInfo?waterwayId=${waterwayId}`
  )
}

// 航道巡检情况
export function getWaterWayInspection(waterwayId, page, size) {
  return request({
    url: `/bridge/waterwaySituation/waterwayInspection`,
    method: 'get',
    params: {
      waterwayId,
      page,
      size,
    },
  })
}
// 航标情况
export function getNavigationMark(waterwayId) {
  return request({
    url: `/bridge/waterwaySituation/getNavigationMark?waterwayId=${waterwayId}`,
    method: 'get',
  })
}
// /桥梁关联桥梁()
export function getRelationBridge(waterwayId) {
  return request.get(
    `/bridge/waterwaySituation/relationBridge?waterwayId=${waterwayId}`
  )
}

// 首页/筛选查询
export function getwaterwayBridgeDistribution(data) {
  return request.post(`/bridge/overall/waterwayBridgeDistribution`, data)
}
// 全年通航船舶吨位统计
export function getAnnualShipNavigateTonsTotal() {
  return request.get(`/bridge/overall/annualShipNavigateTonsTotal`)
}
//近三年来被撞桥梁
export function getrammedBridge() {
  return request.get(`/bridge/overall/rammedBridge`)
}
// 桥梁名称搜索
export function searchByBridgeName(bridgeName) {
  return request({
    url: `/bridge/bridgeSituation/searchByBridgeName`,
    method: 'get',
    params: { bridgeName: bridgeName },
  })
}

//桥梁基本信息
export function getBridgeBaseInfo(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/bridgeBaseInfo`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}
//桥梁设备信息
export function getBridgeEquipment(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/getBridgeEquipment`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}

//桥梁审批文件
export function getBridgeFile(
  bridgeId,
  bridgeFileType,
  pageNum,
  sizeNum,
  bridgeFileName
) {
  return request({
    url: `/bridge/bridgeSituation/approvalFile`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
      bridgeFileType: bridgeFileType,
      page: pageNum,
      size: sizeNum,
      bridgeFileName: bridgeFileName,
    },
  })
}

//航道通告
export function getWaterwayNotice(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/waterwayNotice`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}

//海事通告
export function getMaritimeNotice(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/maritimeNotice`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}

// 一桥方案
export function getBridgePlan(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/bridgePlan`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}

// 桥梁画像
export function getbridgePortrait(bridgeId) {
  return request({
    url: `/bridge/bridgeSituation/bridgePortrait`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
    },
  })
}
// 获取最高最低水位水深
export function getWaterLevelAndDepth(
  bridgeId,
  time,
  byYear,
  byMonth,
  byDay,
  beginTime,
  endTime
) {
  return request({
    url: `/bridge/waterwaySituation/getWaterLevelAndDepth`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
      time: time,
      byYear: byYear,
      byMonth: byMonth,
      byDay: byDay,
      beginTime: beginTime,
      endTime: endTime,
    },
  })
}

// 水位统计
export function getWaterLevelStatistic(
  bridgeId,
  time,
  byYear,
  byMonth,
  byDay,
  beginTime,
  endTime
) {
  return request({
    url: `/bridge/waterwaySituation/waterLevelStatistic`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
      time: time,
      byYear: byYear,
      byMonth: byMonth,
      byDay: byDay,
      beginTime: beginTime,
      endTime: endTime,
    },
  })
}

// 水位净高统计
export function getNetHeightStatistic(
  bridgeId,
  time,
  byYear,
  byMonth,
  byDay,
  beginTime,
  endTime
) {
  return request({
    url: `/bridge/waterwaySituation/netHeightStatistic`,
    method: 'get',
    params: {
      bridgeId: bridgeId,
      time: time,
      byYear: byYear,
      byMonth: byMonth,
      byDay: byDay,
      beginTime: beginTime,
      endTime: endTime,
    },
  })
}

// 通航统计
export function getShipNavigationStatistic(
  waterwayId,
  time,
  byYear,
  byMonth,
  byDay,
  beginTime,
  endTime
) {
  return request({
    url: `/bridge/waterwaySituation/shipNavigationStatistic`,
    method: 'get',
    params: {
      waterwayId: waterwayId,
      time: time,
      byYear: byYear,
      byMonth: byMonth,
      byDay: byDay,
      beginTime: beginTime,
      endTime: endTime,
    },
  })
}

// 更改航道通告状态
export function updateWaterwayNotice(waterwayNoticeId) {
  return request({
    url: `/bridge/bridgeSituation/updateWaterwayNotice`,
    method: 'get',
    params: {
      waterwayNoticeId: waterwayNoticeId,
    },
  })
}

// 更新海事通告状态
export function updateMaritimeNotice(maritimeNoticeId) {
  return request({
    url: `/bridge/bridgeSituation/updatemaritimeNotice`,
    method: 'get',
    params: {
      maritimeNoticeId: maritimeNoticeId,
    },
  })
}
// 事故点
export function getAccidentBaseInfo() {
  return request({
    url: `/bridge/overall/getAccidentBaseInfo`,
    method: 'get',
  })
}

// 获取一桥一方案工作内容
export function getWorkInfo(bridgePlanId, departCode) {
  return request({
    url: `/bridge/bridgeSituation/getWorkInfo`,
    method: 'get',
    params: {
      bridgePlanId: bridgePlanId,
      departCode: departCode,
    },
  })
}
// 事故信息
export function getAccidentInfo(AccId) {
  return request({
    url: `/bridge/overall/getAccidentInfo`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}
// 事故反馈
export function getAccidentFeedback(AccId) {
  return request({
    url: `/bridge/overall/getAccidentFeedback`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}

// 救援人员
export function getAccidentRescuerList(AccId) {
  return request({
    url: `/bridge/overall/getAccidentRescuerList`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}
// 救援物资
export function getRescueMaterial(AccId) {
  return request({
    url: `bridge/overall/getRescueMaterial`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}
// 救援船舶
export function getRescueShipList(AccId) {
  return request({
    url: `/bridge/overall/getRescueShipList`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}
// 消防车辆
export function getRescueCarList(AccId) {
  return request({
    url: `/bridge/overall/getRescueCarList`,
    method: 'get',
    params: {
      accidentId: AccId,
    },
  })
}
// 一键派送人员
export function getSelectTaskPerson(bridgeAccidentId) {
  return request({
    url: `/bridge/overall/selectTaskPerson`,
    method: 'get',
    params: {
      bridgeAccidentId: bridgeAccidentId,
    },
  })
}

// 获取全省航道相关数据
export function getProvinceWaterwayData() {
  return request({
    url: `service/waterway/overall/getProvinceWaterwayData`,
    method: 'get',
  })
}

// 获取航道通告专栏信息
export function getWaterwayNoticeInfo() {
  return request({
    url: `service/waterway/overall/getWaterwayNoticeInfo`,
    method: 'get',
  })
}

// 船舶概况（静态）
export function getShipsituationSum() {
  return request({
    url: `service/waterway/shipsituation/sum`,
    method: 'get',
  })
}

// 区域中心管辖工作船分布图
export function regionDistributionChart() {
  return request({
    url: `service/waterway/shipsituation/regionDistributionChart`,
    method: 'get',
  })
}

// 地市船舶情况图
export function cityshipsData() {
  return request({
    url: `service/waterway/shipsituation/CityshipsData`,
    method: 'get',
  })
}

// 获取地市船舶数量
export function getShipNum() {
  return request({
    url: `service/waterway/shipsituation/getShipNum`,
    method: 'get',
  })
}

// 航标概况（静态数据）
export function beaconSituationDetail() {
  return request({
    url: `service/waterway/beaconSituation/detail`,
    method: 'get',
  })
}

// 遥测遥控航标分布详情
export function rtuBeaconChart() {
  return request({
    url: `service/waterway/beaconSituation/rtuBeaconChart`,
    method: 'get',
  })
}

// 航道概况数值接口
export function getWaterwayTotalNum() {
  return request({
    url: `service/waterway/waterwaySituation/waterwayTotalNum`,
    method: 'get',
  })
}

// 内河等级航道维护详情接口
export function getnhdjhdDetail() {
  return request({
    url: `service/waterway/waterwaySituation/nhdjhdDetail`,
    method: 'get',
  })
}

// 水位监测详情
export function waterlevelDetail(region, waterway, bridgeName) {
  return request({
    url: `service/waterway/waterlevelSituation/detail`,
    method: 'get',
    params: {
      region: region,
      waterway: waterway,
      bridgeName: bridgeName,
    },
  })
}

// 水位监测趋势
export function trendChart(waterlevelStation, startTime, endTime) {
  return request({
    url: `service/waterway/waterlevelSituation/trendChart`,
    method: 'get',
    params: {
      waterlevelStation: waterlevelStation,
      startTime: startTime,
      endTime: endTime,
    },
  })
}

// 获取水位监测站列表（可模糊搜索）
export function getWaterlevelStationList(stationName) {
  return request({
    url: `service/waterway/waterlevelSituation/getWaterlevelStationList`,
    method: 'get',
    params: {
      stationName: stationName,
    },
  })
}

//获取水位站数据
export function getWaterStation() {
  return request({
    url: `service/waterway/waterlevelSituation/getWaterStation`,
    method: 'get',
  })
}

// 桥梁净高监测详情
export function regionChart() {
  return request({
    url: `service/waterway/bridgeSituation/regionChart`,
    method: 'get',
  })
}

// 桥梁净高监测详情
export function clearHeightDetail(regionName, waterwayName, bridgeName) {
  return request({
    url: `service/waterway/bridgeSituation/clearHeightDetail`,
    method: 'get',
    params: {
      regionName: regionName,
      waterwayName: waterwayName,
      bridgeName: bridgeName,
    },
  })
}

// 桥梁净高监测趋势图
export function clearHeightTrendChart(bridge, regionName, startTime, endTime) {
  return request({
    url: `service/waterway/bridgeSituation/clearHeightTrendChart`,
    method: 'get',
    params: {
      bridge: bridge,
      regionName: regionName,
      startTime: startTime,
      endTime: endTime,
    },
  })
}

// 获取桥梁列表（可模糊搜索）
export function getBridgeList(bridgeName) {
  return request({
    url: `service/waterway/bridgeSituation/getBridgeList`,
    method: 'get',
    params: {
      bridgeName: bridgeName,
    },
  })
}

//获取桥梁数据
export function getAllBridge() {
  return request({
    url: `service/waterway/bridgeSituation/getAllBridge`,
    method: 'get',
  })
}

// 全省船闸概览
export function getShipLockNum() {
  return request({
    url: `service/waterway/shipLockSituation/getShipLockNum`,
    method: 'get',
  })
}

// 获取船闸维护所属航道部门比例数据
export function getShipLockRate() {
  return request({
    url: `service/waterway/shipLockSituation/getShipLockRate`,
    method: 'get',
  })
}

// 船闸过闸详情
export function getShipLockDetail(timeType,timeValue) {
  return request({
    url: `service/waterway/shipLockSituation/getShipLockDetail`,
    method: 'get',
    params: {
      timeType: timeType,
      timeValue: timeValue
    },
  })
}

// 船闸过闸趋势分析
export function analysisData(year1,year2) {
  return request({
    url: `service/waterway/shipLockSituation/analysisData`,
    method: 'get',
    params: {
      year1: year1,
      year2: year2
    },
  })
}

// 过闸货源分析图
export function goodsAnalysisChart(timeType,timeValue) {
  return request({
    url: `service/waterway/shipLockSituation/GoodsAnalysisChart`,
    method: 'get',
    params: {
      timeType: timeType,
      timeValue: timeValue
    },
  })
}

// 获取年份
export function getYearList() {
  return request({
    url: `service/waterway/shipLockSituation/getYearList`,
    method: 'get',
  })
}

// 获取区域中心列表
export function getRegionList() {
  return request({
    url: `service/waterway/dict/getRegionList`,
    method: 'get',
  })
}

// 获取航道列表
export function getWaterwayList(region) {
  return request({
    url: `service/waterway/dict/getWaterwayList`,
    method: 'get',
    params: {
      region: region
    },
  })
}
export function getWaterwayListNew(region) {
  return request({
    url: `service/waterway/waterlevelSituation/getWaterwayList`,
    method: 'get',
    params: {
      region: region
    },
  })
}
// 获取航道通告专栏前3条信息 
export function getWaterwayNoticeThree() {
  return request({
    url: `service/waterway/overall/getWaterwayNoticeThree`,
    method: 'get',
  })
}
// 电子航道图接口--区域中心 
export function getMarkPoint() {
  return request({
    url: `service/waterway/waterwaySituation/Electronicwaterwaychart`,
    method: 'get',
  })
}
// 视频列表
export function videoCategory(flag) {
  return request({
    url: `service/waterway/video/videoCategory`,
    method: 'get',
    params: {
      flag: flag
    },
  })
}
// 视频详情
export function playVideo(id) {
  return request({
    url: `service/waterway/video/vedio_play`,
    method: 'get',
    params: {
      resid: id
    },
  })
}
// 获取已接入视频数
export function getVideoNum() {
  return request({
    url: `service/waterway/video/getVideoNum`,
    method: 'get',
  })
}

//数字水运首页统计数
export function provinceSit() {
  return request({
    url: `service/bridgeControl/overall/provinceSit`,
    method: 'get',
  })
}

//工作船舶
export function shipInfo() {
  return request({
    url: `service/waterway/shipsituation/shipInfo`,
    method: 'get',
  })
}

//遥测遥控航标
export function pharosPlace(params) {
  return request({
    url: `service/bridgeControl/pharos/pharosPlace`,
    method: 'get',
    params: params
  })
}

//行政审批
export function adminApproval() {
  return request({
    url: `service/waterway/Static/admin_approval`,
    method: 'get',
  })
}

//桥梁动态通航净高数据
export function clearHeightTrendChartStatic(bridge, regionName, startTime, endTime) {
  return request({
    url: `service/waterway/Static/clearHeightTrendChart_static`,
    method: 'get',
    params: {
      bridge: bridge,
      regionName: regionName,
      startTime: startTime,
      endTime: endTime,
    },
  })
}

//流速流量
export function lslxStatic() {
  return request({
    url: `service/waterway/Static/lslx_static`,
    method: 'get',
  })
}

//航道基础信息
export function channelBase() {
  return request({
    url: `service/waterway/Static/channeBase`,
    method: 'get',
  })
}

//航道检查
export function channelCheck() {
  return request({
    url: `service/waterway/Static/channelCheck`,
    method: 'get',
  })
}

//航标基础数据
export function pharosBase() {
  return request({
    url: `service/waterway/Static/PharosBase`,
    method: 'get',
  })
}

//智慧船闸基础数据
export function lockBase() {
  return request({
    url: `service/waterway/Static/lockBase`,
    method: 'get',
  })
}

//警戒水位
export function warnWaterLevel(waterlevelStation, startTime, endTime) {
  return request({
    url: `service/waterway/Static/waterlevel`,
    method: 'get',
    params: {
      waterlevelStation: waterlevelStation,
      startTime: startTime,
      endTime: endTime,
    },
  })
}

//港口经纬度
export function getPosition() {
  return request({
    url: `service/waterway/overall/getPosition`,
    method: "get",
  });
}

// 行政许可
export function getLicenceInfo() {
  return request({
    url: `service/waterway/licenceStatistic/licenceInfo`,
    method: 'get',
  })
}